--MemoNotes Script Installer v1.0 26Jan88 by Peter Fraterdeus
--This Button can be modified to install or "de-install" any script into
--any object. I'll leave it up to you to figure out!
on mouseUp
global tempScript
put msg into tempmsg
get the script of stack "Home"
put it into tempScript
put ">MemoNote" into targText
if the optionkey is down then
DeleteScript targText
set the name of me to "Install MemoNotes‚Ñ¢"
set the script of stack "Home" to tempScript
put tempMsg
exit mouseUp
end if
if it contains targText then
put it into TempScript
answer "MemoNote already Installed!" with "Re-Install" or "Cancel"
if it = "Re-Install" then
DeleteScript targText
else -- don't re-install
put tempMsg
exit mouseup
end if
end if
put "Inserting New Script…"
put the script of stack "MemoNoteStack*4.0" before tempScript
set the script of stack "Home" to tempScript
put tempMsg
end mouseup
on mousedown
if the optionkey is down then
set the name of me to "De-Install"
else
set the name of me to "Install MemoNotes‚Ñ¢"
end if
end mousedown
on DeleteScript TargText
global tempScript
set the cursor to 4
put TempScript into it
put the number of lines in it into msg
put 0 into n
Put "Analyzing Script…"
repeat with i=1 to the number of lines in it
if line i of it contains targText then add 1 to n
end repeat
if n<>2 then
Answer"Unbalanced Script - Can't Auto Update" with "OK"
exit to hypercard
end if
put 0 into n
Put "Deleting Old Script…"
repeat until line n of it contains targText
add 1 to n
end repeat
delete line n of it
repeat until line n of it contains targText
delete line n of it
end repeat
delete line n of it
put it into tempScript
end deleteScript
-- part 9 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=48 top=176 right=195 bottom=189
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: MemoNote Settings
----- HyperTalk script -----
on mouseUp
go to card id 4731
end mouseUp
-- part contents for card part 1
----- text -----
The Install MemoNotes‚Ñ¢ button has been thoroughly tested and contains safeguards against fouling up your Home stack.
If MemoNotes is already installed, you are given the option of re-installing it. This is primarily for upgrading…
If the option key is down, the button says "De-Install", and it will remove the MemoNotes system from your Home stack.
The Installer depends on the two
">MemoNote" delimiters which are installed with the script. If there are more or less than two, the Installer will tell you that the script is unbalanced and can't be auto-deleted. Everything between the two limits will be removed.